package com.apex.oauth.security.cas.component;

import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;

/**
 * Create by IntelliJ IDEA
 * 用户：王建
 * 日期：2018-4-3
 */
@Component
public class CustomUserDetailsService implements UserDetailsService {

    /*@Autowired
    private UserDomain domain;*/

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        /*LOG.debug("当前的用户名是："+username);
        SecurityUser user=findByLoginId(username);
        SecurityUser userInfo = new SecurityUser(user);*/
        return null;
    }
   /* public SecurityUser findByLoginId(String loginId) {
        String code = domain.findUserByUserId(loginId);
        if (!StringUtils.isEmpty(code)) {
            Any any = JsonIterator.deserialize(code);
            if (null != any) {
                List<Any> list = any.asList();
                if (null != list && list.size() > 0) {
                    Any any1 = list.get(0);
                    SecurityUser user = any1.as(SecurityUser.class);
                    return user;
                }
            }
        }
        return null;
    }*/
}
